package com.jinzhi.jzdoor.certificate.config;

import com.jinzhi.jzdoor.certificate.service.SmsLimitService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;


@Component
public class SmsLimitScheduler {

    @Autowired
    private SmsLimitService smsLimitService;

    /**
     * 每天凌晨重置计数器
     */
    @Scheduled(cron = "0 0 0 * * ?")
    public void resetSmsCounts() {
        smsLimitService.resetCounts();
    }
}
